home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume14 / ms_sh-1.6 / patch02 next >
Encoding:
Text File  |  1990-08-29  |  39.7 KB  |  1,513 lines

  1. Newsgroups: comp.sources.misc
  2. from: istewart@datlog.co.uk
  3. subject: v14i065: MS-Shell Patch 1.6.3 - Part 1 of 2
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 14, Issue 65
  7. Submitted-by: istewart@datlog.co.uk
  8. Archive-name: ms_sh-1.6/patch02
  9.  
  10. This is patch 1.6.3 for the MS-DOS Shell.  It fixes a number of minor
  11. problems in the shell, addes a few new features and fixes on major problem
  12. in the directory handling functions.  The changes are detailed in the
  13. Readme update and the change logs.  Some of the files have changed because
  14. I have moved to GNU RCS 4.2.
  15.  
  16. Most of the patches that Kai Uwe Rommel posted in comp.binaries.ibm.pc.d
  17. have been implemented.  The main one I left one was that which allowed
  18. the user to execute COMMAND.COM internal commands by having COMMAND.COM
  19. automatically invoked.  There were three reasons for leaving it out 1) the
  20. problem of wild card expansion - the shell does wildcard expansion before
  21. invoking a program which is likely to cause command.com to reject the
  22. command; 2) if the user really wants these commands, they can be generated
  23. just as easily using functions:
  24.   
  25.      dir () { command /c dir $1; }
  26.  
  27. and 3) some of the command.com internal commands have Unix equivalents and
  28. the Unix equivalent tend to be more feature loaded.  If you don't like it,
  29. you can always install Kai's patches yourself.  This is not to say don't
  30. mail me changes.  I just don't think this one is appropriate.
  31.  
  32. Other than that, here it is.  The two shars generate Patch1.6.3 which
  33. should be applied via patch -p <Patch1.6.3 from the shell source root
  34. directory.
  35.  
  36. Regards,
  37.  
  38. Ian Stewartson
  39. Data Logic Ltd, Queens House, Greenhill Way, Harrow, Middlesex, HA1 1YR, UK.
  40. (Phone) +44 81 863 0383 (Telex) 888103 (Fax) +44 81 861 2010
  41. (Network) istewart@datlog.co.uk or ukc!datlog!istewart
  42.  
  43. ----CUT HERE----
  44. #!/bin/sh
  45. # This is a shell archive (shar 3.21)
  46. # made 08/21/1990 20:17 UTC by istewart@datlog.co.uk
  47. # Source directory /usr/proj1/ssd/istewart/src/shell
  48. #
  49. # existing files WILL be overwritten
  50. #
  51. # This is part 1 of a multipart archive                                    
  52. # do not concatenate these parts, unpack them in order with /bin/sh        
  53. #
  54. # This shar contains:
  55. # length  mode       name
  56. # ------ ---------- ------------------------------------------
  57. #  51095 -rw-r--r-- Patch1.6.3
  58. #
  59. if touch 2>&1 | fgrep '[-amc]' > /dev/null
  60.  then TOUCH=touch
  61.  else TOUCH=true
  62. fi
  63. if test -r @shar_seq_.tmp; then
  64.     echo "Must unpack archives in sequence!"
  65.     next=`cat @shar_seq_.tmp`; echo "Please unpack part $next next"
  66.     exit 1
  67. fi
  68. # ============= Patch1.6.3 ==============
  69. echo "x - extracting Patch1.6.3 (Text)"
  70. sed 's/^X//' << 'SHAR_EOF' > Patch1.6.3 &&
  71. XIndex: Notes1.6
  72. X*** ../sh16.2/Notes1.6    Tue Jun 26 19:46:22 1990
  73. X--- Notes1.6    Fri Aug 17 21:29:59 1990
  74. X***************
  75. X*** 1,4 ****
  76. X! Version 1.6.2 Release Notes:
  77. X  
  78. X  Note: Release 1.6.1 did occur to comp.ibm.pc.binaries.  However, the
  79. X  transmission was corrupt and by the time I was notified (the moderator having
  80. X--- 1,4 ----
  81. X! Version 1.6.3 Release Notes:
  82. X  
  83. X  Note: Release 1.6.1 did occur to comp.ibm.pc.binaries.  However, the
  84. X  transmission was corrupt and by the time I was notified (the moderator having
  85. X***************
  86. X*** 35,40 ****
  87. X--- 35,46 ----
  88. X    18.    The directory routines have been modified to correctly handle
  89. X      all valid Unix format directory names (ie a Unix directory name
  90. X      can end in /.  However, DOS does not think this is a directory).
  91. X+   19.    A bug in director.c which caused the shell to crash or hang has
  92. X+     been fixed.
  93. X+   20.    The DOS 4 command processor does not like the use of switchar.
  94. X+     The code has been fixed to cope with DOS 4.
  95. X+   21.    A bug in the processing of functions has been fixed which caused
  96. X+     the shell to crash or hang has been fixed.
  97. X  
  98. X  The following enhancements have been made:
  99. X  
  100. X***************
  101. X*** 69,74 ****
  102. X--- 75,83 ----
  103. X      data and stack space after the first write.
  104. X     19.    The ms_dio function have been enhanced to support raw and block
  105. X      devices (well not really - just the stat and fstat functions).
  106. X+    20.  The POSIX variable substitution command ${#name} to give the
  107. X+     string length has been implemented.
  108. X+    21.  The POSIX I/O option <> has been implemented.
  109. X  
  110. X  The following enhancements/bugs remain outstanding:
  111. X  
  112. XIndex: ReadMe
  113. XPrereq: 1.7
  114. X*** ../sh16.2/ReadMe    Fri Apr  6 17:58:18 1990
  115. X--- ReadMe    Fri Aug 17 21:31:12 1990
  116. X***************
  117. X*** 13,21 ****
  118. X   2.  The sources (or parts thereof) or objects generated from the
  119. X       sources (or parts of sources) cannot be sold under any circumstances.
  120. X  
  121. X!     $Header: readme 1.7 90/04/03 18:07:01 MS_user Exp $
  122. X  
  123. X      $Log:    readme $
  124. X      Revision 1.7  90/04/03  18:07:01  MS_user
  125. X      Some changes for 1.6 (Int 24 and Config file)
  126. X      
  127. X--- 13,24 ----
  128. X   2.  The sources (or parts thereof) or objects generated from the
  129. X       sources (or parts of sources) cannot be sold under any circumstances.
  130. X  
  131. X!     $Header: C:/SRC/SHELL/RCS/readme 1.8 90/08/15 01:18:53 MS_user Exp $
  132. X  
  133. X      $Log:    readme $
  134. X+     Revision 1.8  90/08/15  01:18:53  MS_user
  135. X+     Add 1.6.3 comment
  136. X+     
  137. X      Revision 1.7  90/04/03  18:07:01  MS_user
  138. X      Some changes for 1.6 (Int 24 and Config file)
  139. X      
  140. X***************
  141. X*** 107,112 ****
  142. X--- 110,117 ----
  143. X      Unix V.4.
  144. X  
  145. X  11) A configuration file is supported to allow edit key specification.
  146. X+ 
  147. X+ 12) The support of POSIX P1003.2 commands has been started.
  148. X  
  149. X  The shell was built using MS-DOS C and MASM v5.1 in large model mode.
  150. X  
  151. XIndex: lib/director.c
  152. X*** ../sh16.2/lib/director.c    Fri Jun 22 09:18:24 1990
  153. X--- lib/director.c    Fri Aug 17 21:31:57 1990
  154. X***************
  155. X*** 20,28 ****
  156. X  #include <dos.h>
  157. X  
  158. X  #define    ATTRIBUTES        (_A_SUBDIR | _A_HIDDEN | _A_SYSTEM | \
  159. X!                  _A_NORMAL | _A_RDONLY | _A_ARCH | _A_VOLID)
  160. X  
  161. X! static void    free_dircontents (struct _dircontents *);
  162. X  
  163. X  DIR    *opendir(name)
  164. X  char    *name;
  165. X--- 20,29 ----
  166. X  #include <dos.h>
  167. X  
  168. X  #define    ATTRIBUTES        (_A_SUBDIR | _A_HIDDEN | _A_SYSTEM | \
  169. X!                  _A_NORMAL | _A_RDONLY | _A_ARCH)
  170. X  
  171. X! typedef struct _dircontents    DIRCONT;
  172. X! static void            free_dircontents (DIRCONT *);
  173. X  
  174. X  DIR    *opendir(name)
  175. X  char    *name;
  176. X***************
  177. X*** 30,36 ****
  178. X      struct stat        statb;
  179. X      DIR            *dirp;
  180. X      char        *last;
  181. X!     struct _dircontents    *dp;
  182. X      char        *nbuf;
  183. X      struct find_t    dtabuf;
  184. X      int            len = strlen (name);
  185. X--- 31,37 ----
  186. X      struct stat        statb;
  187. X      DIR            *dirp;
  188. X      char        *last;
  189. X!     DIRCONT        *dp;
  190. X      char        *nbuf;
  191. X      struct find_t    dtabuf;
  192. X      int            len = strlen (name);
  193. X***************
  194. X*** 41,47 ****
  195. X      return (DIR *)NULL;
  196. X      }
  197. X  
  198. X!     if ((nbuf = malloc (len + 4)) == (char *)NULL)
  199. X      return (DIR *) NULL;
  200. X  
  201. X      strcpy (nbuf, name);
  202. X--- 42,48 ----
  203. X      return (DIR *)NULL;
  204. X      }
  205. X  
  206. X!     if ((nbuf = malloc (len + 5)) == (char *)NULL)
  207. X      return (DIR *) NULL;
  208. X  
  209. X      strcpy (nbuf, name);
  210. X***************
  211. X*** 90,97 ****
  212. X      strcat (last, "*.*");
  213. X  
  214. X      dirp->dd_loc      = 0;
  215. X!     dirp->dd_cp       = (struct _dircontents *) NULL;
  216. X!     dirp->dd_contents = (struct _dircontents *) NULL;
  217. X  
  218. X      if (_dos_findfirst (nbuf, ATTRIBUTES, &dtabuf) != 0)
  219. X      {
  220. X--- 91,98 ----
  221. X      strcat (last, "*.*");
  222. X  
  223. X      dirp->dd_loc      = 0;
  224. X!     dirp->dd_cp       = (DIRCONT *) NULL;
  225. X!     dirp->dd_contents = (DIRCONT *) NULL;
  226. X  
  227. X      if (_dos_findfirst (nbuf, ATTRIBUTES, &dtabuf) != 0)
  228. X      {
  229. X***************
  230. X*** 101,124 ****
  231. X  
  232. X      do 
  233. X      {
  234. X!     if (((dp = (struct _dircontents *) malloc (sizeof (struct _dircontents))) == (struct _dircontents *) NULL) ||
  235. X          ((dp->_d_entry = strdup (dtabuf.name)) == (char *) NULL))
  236. X      {
  237. X          if (dp != (char *)NULL)
  238. X!         free ((char *) dp);
  239. X  
  240. X          free (nbuf);
  241. X          free_dircontents (dirp->dd_contents);
  242. X          return (DIR *) NULL;
  243. X      }
  244. X  
  245. X!     if (dirp->dd_contents)
  246. X          dirp->dd_cp = dirp->dd_cp->_d_next = dp;
  247. X  
  248. X      else
  249. X          dirp->dd_contents = dirp->dd_cp = dp;
  250. X  
  251. X!     dp->_d_next = (struct _dircontents *) NULL;
  252. X  
  253. X      } while (_dos_findnext (&dtabuf) == 0);
  254. X  
  255. X--- 102,125 ----
  256. X  
  257. X      do 
  258. X      {
  259. X!     if (((dp = (DIRCONT *) malloc (sizeof (DIRCONT))) == (DIRCONT *)NULL) ||
  260. X          ((dp->_d_entry = strdup (dtabuf.name)) == (char *) NULL))
  261. X      {
  262. X          if (dp != (char *)NULL)
  263. X!         free ((char *)dp);
  264. X  
  265. X          free (nbuf);
  266. X          free_dircontents (dirp->dd_contents);
  267. X          return (DIR *) NULL;
  268. X      }
  269. X  
  270. X!     if (dirp->dd_contents != (DIRCONT *) NULL)
  271. X          dirp->dd_cp = dirp->dd_cp->_d_next = dp;
  272. X  
  273. X      else
  274. X          dirp->dd_contents = dirp->dd_cp = dp;
  275. X  
  276. X!     dp->_d_next = (DIRCONT *) NULL;
  277. X  
  278. X      } while (_dos_findnext (&dtabuf) == 0);
  279. X  
  280. X***************
  281. X*** 132,138 ****
  282. X  DIR    *dirp;
  283. X  {
  284. X      free_dircontents (dirp->dd_contents);
  285. X!     free ((char *) dirp);
  286. X      return 0;
  287. X  }
  288. X  
  289. X--- 133,139 ----
  290. X  DIR    *dirp;
  291. X  {
  292. X      free_dircontents (dirp->dd_contents);
  293. X!     free ((char *)dirp);
  294. X      return 0;
  295. X  }
  296. X  
  297. X***************
  298. X*** 141,147 ****
  299. X  {
  300. X      static struct dirent    dp;
  301. X      
  302. X!     if (dirp->dd_cp == (struct _dircontents *) NULL)
  303. X      return (struct dirent *) NULL;
  304. X  
  305. X      dp.d_reclen = strlen (strcpy (dp.d_name, dirp->dd_cp->_d_entry));
  306. X--- 142,148 ----
  307. X  {
  308. X      static struct dirent    dp;
  309. X      
  310. X!     if (dirp->dd_cp == (DIRCONT *) NULL)
  311. X      return (struct dirent *) NULL;
  312. X  
  313. X      dp.d_reclen = strlen (strcpy (dp.d_name, dirp->dd_cp->_d_entry));
  314. X***************
  315. X*** 163,175 ****
  316. X  DIR    *dirp;
  317. X  off_t    off;
  318. X  {
  319. X!     long        i = off;
  320. X!     struct _dircontents    *dp;
  321. X  
  322. X      if (off < 0L)
  323. X      return;
  324. X  
  325. X!     for (dp = dirp->dd_contents ; --i >= 0 && dp ; dp = dp->_d_next)
  326. X      ;
  327. X  
  328. X      dirp->dd_loc = off - (i + 1);
  329. X--- 164,177 ----
  330. X  DIR    *dirp;
  331. X  off_t    off;
  332. X  {
  333. X!     long    i = off;
  334. X!     DIRCONT    *dp;
  335. X  
  336. X      if (off < 0L)
  337. X      return;
  338. X  
  339. X!     for (dp = dirp->dd_contents; (--i >= 0) && (dp != (DIRCONT *)NULL);
  340. X!      dp = dp->_d_next)
  341. X      ;
  342. X  
  343. X      dirp->dd_loc = off - (i + 1);
  344. X***************
  345. X*** 182,198 ****
  346. X      return dirp->dd_loc;
  347. X  }
  348. X  
  349. X! static void        free_dircontents(dp)
  350. X! struct _dircontents    *dp;
  351. X  {
  352. X!     struct _dircontents    *odp;
  353. X  
  354. X!     while (dp) 
  355. X      {
  356. X!     if (dp->_d_entry)
  357. X!         free(dp->_d_entry);
  358. X  
  359. X!     dp = (odp = dp)->_d_next;
  360. X!     free((char *) odp);
  361. X      }
  362. X  }
  363. X--- 184,200 ----
  364. X      return dirp->dd_loc;
  365. X  }
  366. X  
  367. X! static void    free_dircontents (dp)
  368. X! DIRCONT        *dp;
  369. X  {
  370. X!     DIRCONT    *odp;
  371. X  
  372. X!     while ((odp = dp) != (DIRCONT *)NULL) 
  373. X      {
  374. X!     if (dp->_d_entry != (char *)NULL)
  375. X!         free (dp->_d_entry);
  376. X  
  377. X!     dp = dp->_d_next;
  378. X!     free ((char *)odp);
  379. X      }
  380. X  }
  381. XIndex: sh.1
  382. XPrereq: 1.10
  383. X*** ../sh16.2/sh.1    Tue May  1 20:02:16 1990
  384. X--- sh.1    Fri Aug 17 21:31:41 1990
  385. X***************
  386. X*** 14,22 ****
  387. X  .\" 2.  The sources (or parts thereof) or objects generated from the sources
  388. X  .\"     (or parts of sources) cannot be sold under any circumstances.
  389. X  .\"
  390. X! .\"    $Header: sh.1 1.10 90/05/01 19:58:38 MS_user Exp $
  391. X  .\"
  392. X  .\"    $Log:    sh.1 $
  393. X  .\"    Revision 1.10  90/05/01  19:58:38  MS_user
  394. X  .\"    Fix typing error
  395. X  .\"    
  396. X--- 14,25 ----
  397. X  .\" 2.  The sources (or parts thereof) or objects generated from the sources
  398. X  .\"     (or parts of sources) cannot be sold under any circumstances.
  399. X  .\"
  400. X! .\"    $Header: C:/SRC/SHELL/RCS/sh.1 1.11 90/08/14 23:17:25 Ian_Stewartson Exp $
  401. X  .\"
  402. X  .\"    $Log:    sh.1 $
  403. X+ .\"    Revision 1.11  90/08/14  23:17:25  Ian_Stewartson
  404. X+ .\"    Add IO read/write open
  405. X+ .\"    
  406. X  .\"    Revision 1.10  90/05/01  19:58:38  MS_user
  407. X  .\"    Fix typing error
  408. X  .\"    
  409. X***************
  410. X*** 487,492 ****
  411. X--- 490,499 ----
  412. X  \fB<\h@-.1m@&\h@-.1m@\-\fR
  413. X  The standard input is closed.  Similarly for the standard output using
  414. X  \fB>\h@-.1m@&\h@-.1m@\-\fR.
  415. X+ .TP
  416. X+ \fBn<\h@-.3m@>word\fR
  417. X+ causes the file \fIword\fR to be opened on file descriptor \fIn\fR for both
  418. X+ reading and writing.  The file must already exist.
  419. X  .PD
  420. X  .PP
  421. X  If any of the above is preceded by a digit, the file descriptor which will be
  422. XIndex: shell/sh3.c
  423. XPrereq: 1.22
  424. X*** ../sh16.2/shell/sh3.c    Thu Jun 21 21:48:04 1990
  425. X--- shell/sh3.c    Fri Aug 17 21:34:34 1990
  426. X***************
  427. X*** 13,21 ****
  428. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  429. X   *     (or parts of sources) cannot be sold under any circumstances.
  430. X   *
  431. X!  *    $Header: sh3.c 1.22 90/06/21 11:10:47 MS_user Exp $
  432. X   *
  433. X   *    $Log:    sh3.c $
  434. X   * Revision 1.22  90/06/21  11:10:47  MS_user
  435. X   * Ensure Areanum is set correctly for memory areas
  436. X   * 
  437. X--- 13,28 ----
  438. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  439. X   *     (or parts of sources) cannot be sold under any circumstances.
  440. X   *
  441. X!  *    $Header: C:/SRC/SHELL/RCS/sh3.c 1.24 90/08/16 10:28:47 Ian_Stewartson Exp $
  442. X   *
  443. X   *    $Log:    sh3.c $
  444. X+  * Revision 1.24  90/08/16  10:28:47  Ian_Stewartson
  445. X+  * Find setting of switch character for DOS4 for batch files
  446. X+  * 
  447. X+  * Revision 1.23  90/08/14  23:34:09  MS_user
  448. X+  * Fix memory bugs - Copy function tree before execution
  449. X+  * Save Extended line file name correctly
  450. X+  * 
  451. X   * Revision 1.22  90/06/21  11:10:47  MS_user
  452. X   * Ensure Areanum is set correctly for memory areas
  453. X   * 
  454. X***************
  455. X*** 213,219 ****
  456. X          Break_List  = (Break_C *)NULL;
  457. X          bc.nextlev  = SShell_List;
  458. X          SShell_List = &bc;
  459. X!         rv = forkexec (t, pin, pout, act, wp);
  460. X          }
  461. X  
  462. X  /* Restore the original environment */
  463. X--- 220,226 ----
  464. X          Break_List  = (Break_C *)NULL;
  465. X          bc.nextlev  = SShell_List;
  466. X          SShell_List = &bc;
  467. X!         rv = execute (t->left, pin, pout, act);
  468. X          }
  469. X  
  470. X  /* Restore the original environment */
  471. X***************
  472. X*** 472,477 ****
  473. X--- 479,492 ----
  474. X  
  475. X      if (t->type == TCOM)
  476. X      {
  477. X+ 
  478. X+ /* Malloc failed somewhere - given up */
  479. X+ 
  480. X+     if (wp == (char **)NULL)
  481. X+         return setstatus (-1);
  482. X+ 
  483. X+ /* Skip over any assignments */
  484. X+ 
  485. X      while ((cp = *wp++) != (char *)NULL)
  486. X          ;
  487. X  
  488. X***************
  489. X*** 592,597 ****
  490. X--- 607,613 ----
  491. X      Break_C            *s_SList = SShell_List;
  492. X      int            LS_depth = Execute_stack_depth;
  493. X      Break_C            bc;
  494. X+     C_Op            *New;
  495. X  
  496. X  /* Set up $0..$n for the function */
  497. X  
  498. X***************
  499. X*** 604,610 ****
  500. X          Break_List  = (Break_C *)NULL;
  501. X          bc.nextlev  = Return_List;
  502. X          Return_List = &bc;
  503. X!         rv = execute (fop->tree->left, NOPIPE, NOPIPE, FEXEC);
  504. X      }
  505. X  
  506. X  /* A return has been executed - Unlike, while and for, we just need to
  507. X--- 620,627 ----
  508. X          Break_List  = (Break_C *)NULL;
  509. X          bc.nextlev  = Return_List;
  510. X          Return_List = &bc;
  511. X!         New = Copy_Function (fop->tree->left);
  512. X!         rv = execute (New, NOPIPE, NOPIPE, FEXEC);
  513. X      }
  514. X  
  515. X  /* A return has been executed - Unlike, while and for, we just need to
  516. X***************
  517. X*** 719,728 ****
  518. X          cp = "here file";
  519. X          break;
  520. X  
  521. X!     case IOWRITE | IOCAT:            /* >>            */
  522. X          if (check_rsh (cp))
  523. X          return TRUE;
  524. X  
  525. X          if ((u = S_open (FALSE, cp, O_WRONLY | O_TEXT)) >= 0)
  526. X          {
  527. X          lseek (u, 0L, SEEK_END);
  528. X--- 736,752 ----
  529. X          cp = "here file";
  530. X          break;
  531. X  
  532. X!     case IOWRITE | IOREAD:            /* <>            */
  533. X          if (check_rsh (cp))
  534. X          return TRUE;
  535. X  
  536. X+         u = S_open (FALSE, cp, O_RDWR);
  537. X+         break;
  538. X+ 
  539. X+     case IOWRITE | IOCAT:            /* >>            */
  540. X+         if (check_rsh (cp))
  541. X+         return TRUE;
  542. X+ 
  543. X          if ((u = S_open (FALSE, cp, O_WRONLY | O_TEXT)) >= 0)
  544. X          {
  545. X          lseek (u, 0L, SEEK_END);
  546. X***************
  547. X*** 946,952 ****
  548. X              r.x.ax = 0x3700;
  549. X              intdos (&r, &r);
  550. X  
  551. X!             if (r.h.al == 0)
  552. X                  *new_argv[1] = (char)(r.h.dl);
  553. X              }
  554. X  
  555. X--- 970,976 ----
  556. X              r.x.ax = 0x3700;
  557. X              intdos (&r, &r);
  558. X  
  559. X!             if ((r.h.al == 0) && (_osmajor < 4))
  560. X                  *new_argv[1] = (char)(r.h.dl);
  561. X              }
  562. X  
  563. X***************
  564. X*** 1654,1660 ****
  565. X          ((fd = S_open (FALSE, Extend_file = g_tempname (), O_CMASK,
  566. X                 0600)) >= 0))
  567. X      {
  568. X!         Extend_file = strsave (Extend_file, 0);
  569. X  
  570. X  /* Copy to end of list */
  571. X  
  572. X--- 1678,1686 ----
  573. X          ((fd = S_open (FALSE, Extend_file = g_tempname (), O_CMASK,
  574. X                 0600)) >= 0))
  575. X      {
  576. X!         if ((Extend_file = strsave (Extend_file, 0)) == null)
  577. X!         Extend_file = (char *)NULL;
  578. X! 
  579. X  
  580. X  /* Copy to end of list */
  581. X  
  582. XIndex: shell/sh4.c
  583. XPrereq: 1.7
  584. X*** ../sh16.2/shell/sh4.c    Thu Jun 21 21:48:52 1990
  585. X--- shell/sh4.c    Fri Aug 17 21:34:51 1990
  586. X***************
  587. X*** 13,21 ****
  588. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  589. X   *     (or parts of sources) cannot be sold under any circumstances.
  590. X   *
  591. X!  *    $Header: sh4.c 1.7 90/06/21 11:11:51 MS_user Exp $
  592. X   *
  593. X   *    $Log:    sh4.c $
  594. X   * Revision 1.7  90/06/21  11:11:51  MS_user
  595. X   * Ensure Areanum is set correctly for memory areas
  596. X   * 
  597. X--- 13,29 ----
  598. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  599. X   *     (or parts of sources) cannot be sold under any circumstances.
  600. X   *
  601. X!  *    $Header: C:/SRC/SHELL/RCS/sh4.c 1.9 90/08/16 10:29:27 Ian_Stewartson Exp $
  602. X   *
  603. X   *    $Log:    sh4.c $
  604. X+  * Revision 1.9  90/08/16  10:29:27  Ian_Stewartson
  605. X+  * Add support from String length option in ${}.
  606. X+  * Restore the memcpys
  607. X+  * 
  608. X+  * Revision 1.8  90/08/14  23:34:35  MS_user
  609. X+  * Fix memory bugs - ensure string copy is terminated
  610. X+  * Change some memcpys to local copy functions - don't know why.
  611. X+  * 
  612. X   * Revision 1.7  90/06/21  11:11:51  MS_user
  613. X   * Ensure Areanum is set correctly for memory areas
  614. X   * 
  615. X***************
  616. X*** 64,69 ****
  617. X--- 72,78 ----
  618. X  static Word_B        *New_Elist;
  619. X  static char        *spcl  = "[?*";
  620. X  static char        *spcl1 = "\"'";
  621. X+ static char        *bad_subs = "sh: bad substitution\n";
  622. X  
  623. X  static void        globname (char *, char *);
  624. X  static bool        expand (char *, Word_B **, int);
  625. X***************
  626. X*** 135,141 ****
  627. X  {
  628. X      register Word_B    *wb = (Word_B *)NULL;
  629. X      register Var_List    *vp;
  630. X!     char        *cp, *sp;
  631. X      int            len = 0;
  632. X  
  633. X      for (vp = vlist; vp != (Var_List *)NULL; vp = vp->next)
  634. X--- 144,150 ----
  635. X  {
  636. X      register Word_B    *wb = (Word_B *)NULL;
  637. X      register Var_List    *vp;
  638. X!     char        *cp;
  639. X      int            len = 0;
  640. X  
  641. X      for (vp = vlist; vp != (Var_List *)NULL; vp = vp->next)
  642. X***************
  643. X*** 410,415 ****
  644. X--- 419,425 ----
  645. X      register char    *s, c, *cp;
  646. X      Var_List        *vp;
  647. X      bool        colon_f = FALSE;
  648. X+     bool        hash_f = FALSE;
  649. X      char        *dol_special = "$ ";
  650. X  
  651. X      c = (char)readc ();
  652. X***************
  653. X*** 429,435 ****
  654. X          while (((c = (char)readc ()) != 0) && isalnum (c))
  655. X          {
  656. X          if (e.linep < e.eline)
  657. X!             *e.linep++ = c;
  658. X          }
  659. X  
  660. X          unget(c);
  661. X--- 439,445 ----
  662. X          while (((c = (char)readc ()) != 0) && isalnum (c))
  663. X          {
  664. X          if (e.linep < e.eline)
  665. X!             *e.linep++ = c;
  666. X          }
  667. X  
  668. X          unget(c);
  669. X***************
  670. X*** 465,475 ****
  671. X          return c;
  672. X      }
  673. X  
  674. X! /* Check for zero length string */
  675. X  
  676. X      if (s == e.linep)
  677. X      {
  678. X!         print_error ("sh: bad substitution\n");
  679. X          gflg++;
  680. X          return c;
  681. X      }
  682. X--- 475,494 ----
  683. X          return c;
  684. X      }
  685. X  
  686. X! /* Check for Hash at start */
  687. X  
  688. X+     if ((*s == '#') && ((s - e.linep) > 1))
  689. X+     {
  690. X+         hash_f = TRUE;
  691. X+         memcpy (s, s + 1, e.linep - s - 1);
  692. X+         --e.linep;
  693. X+     }
  694. X+ 
  695. X+ /* Check for zero length string */
  696. X+ 
  697. X      if (s == e.linep)
  698. X      {
  699. X!         print_error (bad_subs);
  700. X          gflg++;
  701. X          return c;
  702. X      }
  703. X***************
  704. X*** 513,528 ****
  705. X      }
  706. X      }
  707. X  
  708. X! /* Check for * and @ processing */
  709. X  
  710. X      if (s[1] == 0 && (*s == '*' || *s == '@'))
  711. X      {
  712. X      if (dolc > 1)
  713. X      {
  714. X          e.linep = s;
  715. X!         PUSHIO (awordlist, dolv + 1, dol_char);
  716. X!         e.iop->dflag = (char)(!quoted ? DSA_NULL
  717. X!                       : ((*s == '*') ? DSA_STAR : DSA_AMP));
  718. X          return 0;
  719. X      }
  720. X  
  721. X--- 532,575 ----
  722. X      }
  723. X      }
  724. X  
  725. X! /* Cannot have both # & : */
  726. X  
  727. X+     if (hash_f && colon_f)
  728. X+     {
  729. X+     print_error (bad_subs);
  730. X+     gflg++;
  731. X+     return c;
  732. X+     }
  733. X+ 
  734. X+ /* Check for * and @ processing */
  735. X+ 
  736. X      if (s[1] == 0 && (*s == '*' || *s == '@'))
  737. X      {
  738. X      if (dolc > 1)
  739. X      {
  740. X          e.linep = s;
  741. X! 
  742. X! /* If hash flag set, convert to string length */
  743. X! 
  744. X!         if (hash_f)
  745. X!         {
  746. X!         int    slen, n;
  747. X! 
  748. X!         for (n = 1, slen = 0; dolv[n] != (char *)NULL;
  749. X!              slen += (strlen (dolv[n++]) + 1));
  750. X! 
  751. X!         dolp = strsave (putn (slen - 1), areanum);
  752. X!         PUSHIO (aword, dolp, quoted ? qstrchar : strchar);
  753. X!         }
  754. X! 
  755. X!         else
  756. X!         {
  757. X!         PUSHIO (awordlist, dolv + 1, dol_char);
  758. X!         e.iop->dflag = (char)(!quoted ? DSA_NULL
  759. X!                           : ((*s == '*') ? DSA_STAR
  760. X!                                  : DSA_AMP));
  761. X!         }
  762. X! 
  763. X          return 0;
  764. X      }
  765. X  
  766. X***************
  767. X*** 592,597 ****
  768. X--- 639,649 ----
  769. X      gflg++;
  770. X      }
  771. X  
  772. X+ /* If hash flag set, convert to string length */
  773. X+ 
  774. X+     if (hash_f)
  775. X+     dolp = strsave (putn (strlen (dolp)), areanum);
  776. X+ 
  777. X      e.linep = s;
  778. X      PUSHIO (aword, dolp, quoted ? qstrchar : strchar);
  779. X      return 0;
  780. X***************
  781. X*** 821,834 ****
  782. X      for (i = 0; i < C_EList->w_nword; i++)
  783. X      unquote (C_EList->w_words[i]);
  784. X  
  785. X-     qsort (C_EList->w_words, C_EList->w_nword, sizeof (char *), sort_compare);
  786. X- 
  787. X  /* Did we find any files matching the specification.  Yes - add them to
  788. X   * the block
  789. X   */
  790. X  
  791. X      if (C_EList->w_nword)
  792. X      {
  793. X      for (i = 0; i < C_EList->w_nword; i++)
  794. X          wb = addword (C_EList->w_words[i], wb);
  795. X  
  796. X--- 873,887 ----
  797. X      for (i = 0; i < C_EList->w_nword; i++)
  798. X      unquote (C_EList->w_words[i]);
  799. X  
  800. X  /* Did we find any files matching the specification.  Yes - add them to
  801. X   * the block
  802. X   */
  803. X  
  804. X      if (C_EList->w_nword)
  805. X      {
  806. X+     qsort (C_EList->w_words, C_EList->w_nword, sizeof (char *),
  807. X+            sort_compare);
  808. X+ 
  809. X      for (i = 0; i < C_EList->w_nword; i++)
  810. X          wb = addword (C_EList->w_words[i], wb);
  811. X  
  812. X***************
  813. X*** 852,858 ****
  814. X  {
  815. X      register char    *np, *cp;
  816. X      char        *name, *gp, *dp;
  817. X-     DIR            *dn;
  818. X      struct dirent    *d_ce;
  819. X      char        dname[NAME_MAX + 1];
  820. X      struct stat        dbuf;
  821. X--- 905,910 ----
  822. X***************
  823. X*** 889,895 ****
  824. X  
  825. X  /* Open the directory */
  826. X  
  827. X!     if ((dn = opendir (dp)) == (DIR *)NULL)
  828. X      {
  829. X      DELETE (dp);
  830. X      DELETE (gp);
  831. X--- 941,947 ----
  832. X  
  833. X  /* Open the directory */
  834. X  
  835. X!     if ((e.cdir = opendir (dp)) == (DIR *)NULL)
  836. X      {
  837. X      DELETE (dp);
  838. X      DELETE (gp);
  839. X***************
  840. X*** 898,908 ****
  841. X  
  842. X  /* Scan for matches */
  843. X  
  844. X!     while ((d_ce = readdir (dn)) != (struct dirent *)NULL)
  845. X      {
  846. X!     if ((*(strcpy (dname, d_ce->d_name)) == '.') && (*gp != '.'))
  847. X          continue;
  848. X  
  849. X      for (cp = dname; *cp; cp++)
  850. X      {
  851. X          if (any (*cp, spcl))
  852. X--- 950,961 ----
  853. X  
  854. X  /* Scan for matches */
  855. X  
  856. X!     while ((d_ce = readdir (e.cdir)) != (struct dirent *)NULL)
  857. X      {
  858. X!     if ((*(strncpy (dname, d_ce->d_name, NAME_MAX)) == '.') && (*gp != '.'))
  859. X          continue;
  860. X  
  861. X+     dname[NAME_MAX] = 0;
  862. X      for (cp = dname; *cp; cp++)
  863. X      {
  864. X          if (any (*cp, spcl))
  865. X***************
  866. X*** 935,941 ****
  867. X      }
  868. X      }
  869. X  
  870. X!     closedir (dn);
  871. X      DELETE (dp);
  872. X      DELETE (gp);
  873. X  }
  874. X--- 988,995 ----
  875. X      }
  876. X      }
  877. X  
  878. X!     closedir (e.cdir);
  879. X!     e.cdir = (DIR *)NULL;
  880. X      DELETE (dp);
  881. X      DELETE (gp);
  882. X  }
  883. X***************
  884. X*** 1034,1055 ****
  885. X  register Word_B    *wb;
  886. X  {
  887. X      register char    **wd;
  888. X!     register nb;
  889. X  
  890. X  /* If the word block is empty or does not exist, return no list */
  891. X  
  892. X      if (wb == (Word_B **)NULL)
  893. X      return (char *)NULL;
  894. X  
  895. X!     if (wb->w_nword == 0)
  896. X      {
  897. X      DELETE (wb);
  898. X      return (char *)NULL;
  899. X      }
  900. X- 
  901. X- /* Get some space for the array and set it up */
  902. X- 
  903. X-     wd = (char **)space (nb = sizeof (char *) * wb->w_nword);
  904. X  
  905. X      memcpy ((char *)wd, (char *)wb->w_words, nb);
  906. X      DELETE (wb);    /* perhaps should done by caller */
  907. X--- 1088,1108 ----
  908. X  register Word_B    *wb;
  909. X  {
  910. X      register char    **wd;
  911. X!     register int    nb;
  912. X  
  913. X  /* If the word block is empty or does not exist, return no list */
  914. X  
  915. X      if (wb == (Word_B **)NULL)
  916. X      return (char *)NULL;
  917. X  
  918. X! /* Get some space for the array and set it up */
  919. X! 
  920. X!     if (((nb = sizeof (char *) * wb->w_nword) == 0) ||
  921. X!     ((wd = (char **)space (nb)) == (char **)NULL))
  922. X      {
  923. X      DELETE (wb);
  924. X      return (char *)NULL;
  925. X      }
  926. X  
  927. X      memcpy ((char *)wd, (char *)wb->w_words, nb);
  928. X      DELETE (wb);    /* perhaps should done by caller */
  929. XIndex: shell/sh5.c
  930. XPrereq: 1.9
  931. X*** ../sh16.2/shell/sh5.c    Thu Jun 21 21:49:29 1990
  932. X--- shell/sh5.c    Fri Aug 17 21:35:07 1990
  933. X***************
  934. X*** 13,21 ****
  935. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  936. X   *     (or parts of sources) cannot be sold under any circumstances.
  937. X   *
  938. X!  *    $Header: sh5.c 1.9 90/05/11 18:45:40 MS_user Exp $
  939. X   *
  940. X   *    $Log:    sh5.c $
  941. X   * Revision 1.9  90/05/11  18:45:40  MS_user
  942. X   * Fix problem when at end of buffer on re-load from file
  943. X   * 
  944. X--- 13,24 ----
  945. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  946. X   *     (or parts of sources) cannot be sold under any circumstances.
  947. X   *
  948. X!  *    $Header: C:/SRC/SHELL/RCS/sh5.c 1.10 90/08/14 23:30:47 Ian_Stewartson Exp $
  949. X   *
  950. X   *    $Log:    sh5.c $
  951. X+  * Revision 1.10  90/08/14  23:30:47  Ian_Stewartson
  952. X+  * Changes to env structure.
  953. X+  * 
  954. X   * Revision 1.9  90/05/11  18:45:40  MS_user
  955. X   * Fix problem when at end of buffer on re-load from file
  956. X   * 
  957. X***************
  958. X*** 58,63 ****
  959. X--- 61,67 ----
  960. X  #include <fcntl.h>
  961. X  #include <io.h>
  962. X  #include <limits.h>
  963. X+ #include <dirent.h>
  964. X  #include <unistd.h>
  965. X  #include "sh.h"
  966. X  
  967. XIndex: shell/sh6.c
  968. XPrereq: 1.13
  969. X*** ../sh16.2/shell/sh6.c    Thu Jun 21 21:49:38 1990
  970. X--- shell/sh6.c    Fri Aug 17 21:35:10 1990
  971. X***************
  972. X*** 13,21 ****
  973. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  974. X   *     (or parts of sources) cannot be sold under any circumstances.
  975. X   *
  976. X!  *    $Header: sh6.c 1.13 90/05/15 21:10:19 MS_user Exp $
  977. X   *
  978. X   *    $Log:    sh6.c $
  979. X   * Revision 1.13  90/05/15  21:10:19  MS_user
  980. X   * Release 1.6.2
  981. X   * 
  982. X--- 13,24 ----
  983. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  984. X   *     (or parts of sources) cannot be sold under any circumstances.
  985. X   *
  986. X!  *    $Header: C:/SRC/SHELL/RCS/sh6.c 1.14 90/08/14 23:34:49 MS_user Exp $
  987. X   *
  988. X   *    $Log:    sh6.c $
  989. X+  * Revision 1.14  90/08/14  23:34:49  MS_user
  990. X+  * Changed for release 1.6.3
  991. X+  * 
  992. X   * Revision 1.13  90/05/15  21:10:19  MS_user
  993. X   * Release 1.6.2
  994. X   * 
  995. X***************
  996. X*** 65,75 ****
  997. X  #include <setjmp.h>
  998. X  #include <stdlib.h>
  999. X  #include <limits.h>
  1000. X  #include <unistd.h>
  1001. X  #include <string.h>
  1002. X  #include "sh.h"
  1003. X  
  1004. X! static char    *Copy_Right1 = "MS-DOS SH Version 1.6.2 - %s (DOS %d.%d)\n";
  1005. X  static char    *Copy_Right2 = "Copyright (c) Data Logic Ltd and Charles Forsyth 1990\n";
  1006. X  char        **dolv;        /* Parameter array            */
  1007. X  int        dolc;        /* Number of entries in parameter array    */
  1008. X--- 68,79 ----
  1009. X  #include <setjmp.h>
  1010. X  #include <stdlib.h>
  1011. X  #include <limits.h>
  1012. X+ #include <dirent.h>
  1013. X  #include <unistd.h>
  1014. X  #include <string.h>
  1015. X  #include "sh.h"
  1016. X  
  1017. X! static char    *Copy_Right1 = "MS-DOS SH Version 1.6.3 - %s (DOS %d.%d)\n";
  1018. X  static char    *Copy_Right2 = "Copyright (c) Data Logic Ltd and Charles Forsyth 1990\n";
  1019. X  char        **dolv;        /* Parameter array            */
  1020. X  int        dolc;        /* Number of entries in parameter array    */
  1021. X***************
  1022. X*** 151,156 ****
  1023. X--- 155,161 ----
  1024. X      (int *)NULL,
  1025. X      FALSE,            /* End of file processing        */
  1026. X      FDBASE,            /* Base file handler            */
  1027. X+     (DIR *)NULL,        /* Currently open directory        */
  1028. X      (Environ *)NULL        /* Previous Env pointer            */
  1029. X  };
  1030. X  
  1031. XIndex: shell/sh7.c
  1032. XPrereq: 1.17
  1033. X*** ../sh16.2/shell/sh7.c    Thu Jun 21 21:50:36 1990
  1034. X--- shell/sh7.c    Fri Aug 17 21:35:57 1990
  1035. X***************
  1036. X*** 15,23 ****
  1037. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  1038. X   *     (or parts of sources) cannot be sold under any circumstances.
  1039. X   *
  1040. X!  *    $Header: sh7.c 1.17 90/05/31 09:50:05 MS_user Exp $
  1041. X   *
  1042. X   *    $Log:    sh7.c $
  1043. X   * Revision 1.17  90/05/31  09:50:05  MS_user
  1044. X   * Implement partial write when swapping to disk
  1045. X   * 
  1046. X--- 15,27 ----
  1047. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  1048. X   *     (or parts of sources) cannot be sold under any circumstances.
  1049. X   *
  1050. X!  *    $Header: C:/SRC/SHELL/RCS/sh7.c 1.18 90/08/14 23:34:55 MS_user Exp $
  1051. X   *
  1052. X   *    $Log:    sh7.c $
  1053. X+  * Revision 1.18  90/08/14  23:34:55  MS_user
  1054. X+  * Fix directory display on change directory
  1055. X+  * Fix spelling mistake.
  1056. X+  * 
  1057. X   * Revision 1.17  90/05/31  09:50:05  MS_user
  1058. X   * Implement partial write when swapping to disk
  1059. X   * 
  1060. X***************
  1061. X*** 88,93 ****
  1062. X--- 92,98 ----
  1063. X  #include <stdlib.h>
  1064. X  #include <fcntl.h>
  1065. X  #include <limits.h>
  1066. X+ #include <dirent.h>
  1067. X  #include <stdarg.h>
  1068. X  #include "sh.h"
  1069. X  
  1070. X***************
  1071. X*** 1026,1032 ****
  1072. X  
  1073. X          Getcwd ();
  1074. X  
  1075. X!         if (first || (strchr (p, '/') != (char *)NULL))
  1076. X          dopwd (t);
  1077. X  
  1078. X          return 0;
  1079. X--- 1031,1037 ----
  1080. X  
  1081. X          Getcwd ();
  1082. X  
  1083. X!         if (first)
  1084. X          dopwd (t);
  1085. X  
  1086. X          return 0;
  1087. X***************
  1088. X*** 1756,1762 ****
  1089. X  #endif
  1090. X  
  1091. X  /*
  1092. X!  * Type fucntion: For each name, indicate how it would be interpreted
  1093. X   */
  1094. X  
  1095. X  static char    *type_ext[] = {
  1096. X--- 1761,1767 ----
  1097. X  #endif
  1098. X  
  1099. X  /*
  1100. X!  * Type function: For each name, indicate how it would be interpreted
  1101. X   */
  1102. X  
  1103. X  static char    *type_ext[] = {
  1104. X***************
  1105. X*** 1789,1794 ****
  1106. X--- 1794,1805 ----
  1107. X  
  1108. X      while ((cp = t->words[n++]) != (char *)NULL)
  1109. X      {
  1110. X+     if (inbuilt (cp))
  1111. X+     {
  1112. X+         v1_puts (cp);
  1113. X+         v1a_puts (" is a shell internal command");
  1114. X+         continue;
  1115. X+     }
  1116. X  
  1117. X  /* Check for a function */
  1118. X  
  1119. X***************
  1120. X*** 1844,1849 ****
  1121. X--- 1855,1861 ----
  1122. X                   (stricmp (xp, ".bat") != 0))
  1123. X              continue;
  1124. X  
  1125. X+             Convert_Backslashes (strlwr (l_path));
  1126. X              print_error ("%s is %s\n", cp, l_path);
  1127. X              found = TRUE;
  1128. X          }
  1129. XIndex: shell/sh8.c
  1130. XPrereq: 1.11
  1131. X*** ../sh16.2/shell/sh8.c    Thu Jun 21 21:51:03 1990
  1132. X--- shell/sh8.c    Fri Aug 17 21:35:41 1990
  1133. X***************
  1134. X*** 12,20 ****
  1135. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  1136. X   *     (or parts of sources) cannot be sold under any circumstances.
  1137. X   *
  1138. X!  *    $Header: sh8.c 1.11 90/06/21 11:12:13 MS_user Exp $
  1139. X   *
  1140. X   *    $Log:    sh8.c $
  1141. X   * Revision 1.11  90/06/21  11:12:13  MS_user
  1142. X   * Ensure Areanum is set correctly for memory areas
  1143. X   * 
  1144. X--- 12,23 ----
  1145. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  1146. X   *     (or parts of sources) cannot be sold under any circumstances.
  1147. X   *
  1148. X!  *    $Header: C:/SRC/SHELL/RCS/sh8.c 1.12 90/08/14 23:31:08 Ian_Stewartson Exp $
  1149. X   *
  1150. X   *    $Log:    sh8.c $
  1151. X+  * Revision 1.12  90/08/14  23:31:08  Ian_Stewartson
  1152. X+  * Changes to env structure.
  1153. X+  * 
  1154. X   * Revision 1.11  90/06/21  11:12:13  MS_user
  1155. X   * Ensure Areanum is set correctly for memory areas
  1156. X   * 
  1157. X***************
  1158. X*** 64,69 ****
  1159. X--- 67,73 ----
  1160. X  #include <string.h>
  1161. X  #include <unistd.h>
  1162. X  #include <limits.h>
  1163. X+ #include <dirent.h>
  1164. X  #include <ctype.h>
  1165. X  #include "sh.h"
  1166. X  
  1167. XIndex: shell/sh9.c
  1168. XPrereq: 1.12
  1169. X*** ../sh16.2/shell/sh9.c    Thu Jun 21 21:51:46 1990
  1170. X--- shell/sh9.c    Fri Aug 17 21:36:02 1990
  1171. X***************
  1172. X*** 12,18 ****
  1173. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  1174. X   *     (or parts of sources) cannot be sold under any circumstances.
  1175. X   *
  1176. X!  *    $Header: sh9.c 1.12 90/05/31 10:39:26 MS_user Exp $
  1177. X   *
  1178. X   *    $Log:    sh9.c $
  1179. X   * Revision 1.12  90/05/31  10:39:26  MS_user
  1180. X--- 12,18 ----
  1181. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  1182. X   *     (or parts of sources) cannot be sold under any circumstances.
  1183. X   *
  1184. X!  *    $Header: C:/SRC/SHELL/RCS/sh9.c 1.12 90/05/31 10:39:26 MS_user Exp $
  1185. X   *
  1186. X   *    $Log:    sh9.c $
  1187. X   * Revision 1.12  90/05/31  10:39:26  MS_user
  1188. XIndex: shell/makefile
  1189. XPrereq: 1.3
  1190. X*** ../sh16.2/shell/makefile    Thu Jun 21 21:43:10 1990
  1191. X--- shell/makefile    Fri Aug 17 21:33:08 1990
  1192. X***************
  1193. X*** 8,16 ****
  1194. X  # source form.
  1195. X  #
  1196. X  #
  1197. X! #    $Header: makefile 1.3 90/01/18 15:41:48 MS_user Locked $
  1198. X  #
  1199. X  #    $Log:    makefile $
  1200. X  # Revision 1.3  90/01/18  15:41:48  MS_user
  1201. X  # ANother change for new make
  1202. X  # 
  1203. X--- 8,25 ----
  1204. X  # source form.
  1205. X  #
  1206. X  #
  1207. X! #    $Header: C:/SRC/SHELL/RCS/makefile 1.6 90/08/16 12:21:40 Ian_Stewartson Exp $
  1208. X  #
  1209. X  #    $Log:    makefile $
  1210. X+ # Revision 1.6  90/08/16  12:21:40  Ian_Stewartson
  1211. X+ # Remove command on sh6.obj line
  1212. X+ # 
  1213. X+ # Revision 1.5  90/08/15  01:42:32  MS_user
  1214. X+ # Remove local directory functions
  1215. X+ # 
  1216. X+ # Revision 1.4  90/08/15  01:16:36  MS_user
  1217. X+ # Add stack command
  1218. X+ # 
  1219. X  # Revision 1.3  90/01/18  15:41:48  MS_user
  1220. X  # ANother change for new make
  1221. X  # 
  1222. X***************
  1223. X*** 22,28 ****
  1224. X  # 
  1225. X  #
  1226. X  
  1227. X! ASFLAGS= /Ml /Zi /Zd
  1228. X  
  1229. X  OBJS=sh0.obj sh1.obj sh2.obj sh3.obj sh4.obj sh5.obj sh6.obj    \
  1230. X       sh7.obj sh8.obj sh9.obj sh10.obj
  1231. X--- 31,37 ----
  1232. X  # 
  1233. X  #
  1234. X  
  1235. X! ASFLAGS= /Ml 
  1236. X  
  1237. X  OBJS=sh0.obj sh1.obj sh2.obj sh3.obj sh4.obj sh5.obj sh6.obj    \
  1238. X       sh7.obj sh8.obj sh9.obj sh10.obj
  1239. X***************
  1240. X*** 34,38 ****
  1241. X  sh6.obj: $(SRCS)
  1242. X  
  1243. X  sh.exe:    $(OBJS)
  1244. X!     link sh0+sh1+sh2+sh3+sh4+sh5+sh6+sh7+sh8+sh9+sh10/co/noi, sh.exe\;
  1245. X!     link sh0+sh1+sh2+sh3+sh4+sh5+sh6+sh7+sh8+sh9+sh10/noi, nd_sh.exe\;
  1246. X--- 43,47 ----
  1247. X  sh6.obj: $(SRCS)
  1248. X  
  1249. X  sh.exe:    $(OBJS)
  1250. X!     link sh0+sh1+sh2+sh3+sh4+sh5+sh6+sh7+sh8+sh9+sh10/co/noi/stack:0x2000, sh.exe\;
  1251. X!     link sh0+sh1+sh2+sh3+sh4+sh5+sh6+sh7+sh8+sh9+sh10/noi/stack:0x2000, nd_sh.exe\;
  1252. XIndex: shell/sh.h
  1253. XPrereq: 1.20
  1254. X*** ../sh16.2/shell/sh.h    Thu Jun 21 21:43:37 1990
  1255. X--- shell/sh.h    Fri Aug 17 21:33:20 1990
  1256. X***************
  1257. X*** 13,21 ****
  1258. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  1259. X   *     (or parts of sources) cannot be sold under any circumstances.
  1260. X   *
  1261. X!  *    $Header: sh.h 1.20 90/05/31 09:47:41 MS_user Exp $
  1262. X   *
  1263. X   *    $Log:    sh.h $
  1264. X   * Revision 1.20  90/05/31  09:47:41  MS_user
  1265. X   * Implement partial write when swapping to disk
  1266. X   * 
  1267. X--- 13,26 ----
  1268. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  1269. X   *     (or parts of sources) cannot be sold under any circumstances.
  1270. X   *
  1271. X!  *    $Header: C:/SRC/SHELL/RCS/sh.h 1.21 90/08/14 23:54:44 MS_user Exp $
  1272. X   *
  1273. X   *    $Log:    sh.h $
  1274. X+  * Revision 1.21  90/08/14  23:54:44  MS_user
  1275. X+  * Add addition value to env structure
  1276. X+  * Add some new publics
  1277. X+  * Update patchlevel
  1278. X+  * 
  1279. X   * Revision 1.20  90/05/31  09:47:41  MS_user
  1280. X   * Implement partial write when swapping to disk
  1281. X   * 
  1282. X***************
  1283. X*** 80,86 ****
  1284. X   * 
  1285. X   */
  1286. X  
  1287. X! #define PATCHLEVEL    6
  1288. X  #define    LINE_MAX    1000    /* Command line length            */
  1289. X  #define HISTORY_MAX    100    /* History array length            */
  1290. X                  /* Space for full file name        */
  1291. X--- 85,91 ----
  1292. X   * 
  1293. X   */
  1294. X  
  1295. X! #define PATCHLEVEL    7
  1296. X  #define    LINE_MAX    1000    /* Command line length            */
  1297. X  #define HISTORY_MAX    100    /* History array length            */
  1298. X                  /* Space for full file name        */
  1299. X***************
  1300. X*** 327,332 ****
  1301. X--- 332,338 ----
  1302. X      int        *errpt;
  1303. X      bool    eof_p;            /* EOF processing enabled    */
  1304. X      int        iofd;
  1305. X+     DIR        *cdir;            /* Currently open directory    */
  1306. X      struct env    *oenv;            /* Previous environment        */
  1307. X  } Environ;
  1308. X  
  1309. X***************
  1310. X*** 622,627 ****
  1311. X--- 628,635 ----
  1312. X  extern void    Print_Version (int);
  1313. X  extern bool    anys (char *, char *);
  1314. X  extern void    Clear_Swap_File (void);
  1315. X+ extern C_Op    *Copy_Function (C_Op *);
  1316. X+ extern void    Convert_Backslashes (char *);
  1317. X  
  1318. X  /*
  1319. X   * Interrupt handling
  1320. XIndex: shell/sh0.asm
  1321. XPrereq: 1.10
  1322. X*** ../sh16.2/shell/sh0.asm    Thu Jun 21 21:45:35 1990
  1323. X--- shell/sh0.asm    Fri Aug 17 21:33:41 1990
  1324. X***************
  1325. X*** 16,22 ****
  1326. X  ; 2.  The sources (or parts thereof) or objects generated from the sources
  1327. X  ;     (or parts of sources) cannot be sold under any circumstances.
  1328. X  ;
  1329. X! ;    $Header: sh0.asm 1.10 90/05/31 17:46:31 MS_user Exp $
  1330. X  ;
  1331. X  ;    $Log:    sh0.asm $
  1332. X  ;    Revision 1.10  90/05/31  17:46:31  MS_user
  1333. X--- 16,22 ----
  1334. X  ; 2.  The sources (or parts thereof) or objects generated from the sources
  1335. X  ;     (or parts of sources) cannot be sold under any circumstances.
  1336. X  ;
  1337. X! ;    $Header: C:/SRC/SHELL/RCS/sh0.asm 1.10 90/05/31 17:46:31 MS_user Exp $
  1338. X  ;
  1339. X  ;    $Log:    sh0.asm $
  1340. X  ;    Revision 1.10  90/05/31  17:46:31  MS_user
  1341. XIndex: shell/sh1.c
  1342. XPrereq: 1.16
  1343. X*** ../sh16.2/shell/sh1.c    Thu Jun 21 21:46:25 1990
  1344. X--- shell/sh1.c    Fri Aug 17 21:32:33 1990
  1345. X***************
  1346. X*** 13,21 ****
  1347. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  1348. X   *     (or parts of sources) cannot be sold under any circumstances.
  1349. X   *
  1350. X!  *    $Header: sh1.c 1.16 90/05/31 09:48:06 MS_user Exp $
  1351. X   *
  1352. X   *    $Log:    sh1.c $
  1353. X   * Revision 1.16  90/05/31  09:48:06  MS_user
  1354. X   * Implement partial write when swapping to disk
  1355. X   * Add some signal lockouts to prevent corruption
  1356. X--- 13,25 ----
  1357. X   * 2.  The sources (or parts thereof) or objects generated from the sources
  1358. X   *     (or parts of sources) cannot be sold under any circumstances.
  1359. X   *
  1360. X!  *    $Header: C:/SRC/SHELL/RCS/sh1.c 1.17 90/08/14 23:32:53 MS_user Exp $
  1361. X   *
  1362. X   *    $Log:    sh1.c $
  1363. X+  * Revision 1.17  90/08/14  23:32:53  MS_user
  1364. X+  * Fix memory bugs - Add malloc checking functions for debug
  1365. X+  * Make Convert_Backslashes public
  1366. X+  * 
  1367. X   * Revision 1.16  90/05/31  09:48:06  MS_user
  1368. X   * Implement partial write when swapping to disk
  1369. X   * Add some signal lockouts to prevent corruption
  1370. X***************
  1371. X*** 83,88 ****
  1372. X--- 87,93 ----
  1373. X  #include <ctype.h>
  1374. X  #include <fcntl.h>
  1375. X  #include <limits.h>
  1376. X+ #include <dirent.h>
  1377. X  #include <dos.h>
  1378. X  #include <time.h>
  1379. X  #include "sh.h"
  1380. X***************
  1381. X*** 92,98 ****
  1382. X--- 97,119 ----
  1383. X   * without having to know about it.
  1384. X   */
  1385. X  
  1386. X+ #undef CHECK_MALLOC
  1387. X+ 
  1388. X+ #ifdef CHECK_MALLOC
  1389. X+ #define    MAGIC1        0xd8a5
  1390. X+ #define    MAGIC2        0xa5d8
  1391. X+ static void        sh_free (void *);
  1392. X+ static void        sh_chkmem (char *, char *, size_t, bool);
  1393. X+ #define SH_FREE        sh_free
  1394. X+ #else
  1395. X+ #define SH_FREE        free
  1396. X+ #endif
  1397. X+ 
  1398. X  typedef struct region {
  1399. X+ #ifdef CHECK_MALLOC
  1400. X+     unsigned int    magic1;
  1401. X+     unsigned int    len;
  1402. X+ #endif
  1403. X      struct region    *next;
  1404. X      int            area;
  1405. X  } s_region;
  1406. X***************
  1407. X*** 125,131 ****
  1408. X  static void    Check_Mail (void);
  1409. X  static void    Pre_Process_Argv (char **);
  1410. X  static void    Load_G_VL (void);
  1411. X- static void    Convert_Backslashes (char *);
  1412. X  static void    Load_profiles (void);
  1413. X  static void    U2D_Path (void);
  1414. X  
  1415. X--- 146,151 ----
  1416. X***************
  1417. X*** 530,540 ****
  1418. X  char    *fmt;
  1419. X  {
  1420. X      va_list    ap;
  1421. X-     char    x[100];
  1422. X  
  1423. X      va_start (ap, fmt);
  1424. X!     vsprintf (x, fmt, ap);
  1425. X!     S_puts (x);
  1426. X      exstat = -1;
  1427. X  
  1428. X  /* If leave on error - exit */
  1429. X--- 550,558 ----
  1430. X  char    *fmt;
  1431. X  {
  1432. X      va_list    ap;
  1433. X  
  1434. X      va_start (ap, fmt);
  1435. X!     vfprintf (stderr, fmt, ap);
  1436. X      exstat = -1;
  1437. X  
  1438. X  /* If leave on error - exit */
  1439. X***************
  1440. X*** 553,565 ****
  1441. X  char    *fmt;
  1442. X  {
  1443. X      va_list    ap;
  1444. X-     char    x[100];
  1445. X  
  1446. X  /* Error message processing */
  1447. X  
  1448. X      va_start (ap, fmt);
  1449. X!     vsprintf (x, fmt, ap);
  1450. X!     S_puts (x);
  1451. X      exstat = -1;
  1452. X  
  1453. X      if (FL_TEST ('e'))
  1454. X--- 571,581 ----
  1455. X  char    *fmt;
  1456. X  {
  1457. X      va_list    ap;
  1458. X  
  1459. X  /* Error message processing */
  1460. X  
  1461. X      va_start (ap, fmt);
  1462. X!     vfprintf (stderr, fmt, ap);
  1463. X      exstat = -1;
  1464. X  
  1465. X      if (FL_TEST ('e'))
  1466. X***************
  1467. X*** 636,641 ****
  1468. X--- 652,665 ----
  1469. X  
  1470. X      if ((ep = e.oenv) != (Environ *)NULL)
  1471. X      {
  1472. X+ 
  1473. X+ /* Close any open directories */
  1474. X+ 
  1475. X+     if (e.cdir != (DIR *)NULL)
  1476. X+         closedir (e.cdir);
  1477. X+ 
  1478. X+ /* Get the files used in this environment to close */
  1479. X+ 
  1480. X      fd = e.iofd;
  1481. X      e = *ep;
  1482. X  
  1483. X***************
  1484. X*** 1269,1290 ****
  1485. X   * Get a string in a malloced area
  1486. X   */
  1487. X  
  1488. X! char        *getcell(nbytes)
  1489. X  unsigned int    nbytes;
  1490. X  {
  1491. X      s_region        *np;
  1492. X      void        (*save_signal)(int);
  1493. X  
  1494. X      if (nbytes == 0)
  1495. X      abort ();    /* silly and defeats the algorithm */
  1496. X  
  1497. X  /* Grab some space */
  1498. X  
  1499. X!     if ((np = (s_region *)calloc (nbytes + sizeof (s_region), 1)) == (s_region *)NULL)
  1500. X!         return (char *)NULL;
  1501. X  
  1502. X! /* Disable signals */
  1503. X  
  1504. X      save_signal = signal (SIGINT, SIG_IGN);
  1505. X  
  1506. X  /* Link into chain */
  1507. SHAR_EOF
  1508. echo "End of  part 1"
  1509. echo "File Patch1.6.3 is continued in part 2"
  1510. echo "2" > @shar_seq_.tmp
  1511. exit 0
  1512.  
  1513.